package com.wz.project.bas.customerGroup.service.impl;

import com.wz.common.utils.text.Convert;
import com.wz.project.bas.customerGroup.domain.BasCustomerGroup;
import com.wz.project.bas.customerGroup.mapper.BasCustomerGroupMapper;
import com.wz.project.bas.customerGroup.service.IBasCustomerGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 客户组Service业务层处理
 * 
 * @author wz
 * @date 2022-02-10
 */
@Service
public class BasCustomerGroupServiceImpl implements IBasCustomerGroupService 
{
    @Autowired
    private BasCustomerGroupMapper basCustomerGroupMapper;

    /**
     * 查询客户组
     * 
     * @param customerGroupNo 客户组ID
     * @return 客户组
     */
    @Override
    public BasCustomerGroup selectBasCustomerGroupById(String customerGroupNo)
    {
        return basCustomerGroupMapper.selectBasCustomerGroupById(customerGroupNo);
    }

    /**
     * 查询客户组列表
     * 
     * @param basCustomerGroup 客户组
     * @return 客户组
     */
    @Override
    public List<BasCustomerGroup> selectBasCustomerGroupList(BasCustomerGroup basCustomerGroup)
    {
        return basCustomerGroupMapper.selectBasCustomerGroupList(basCustomerGroup);
    }

    /**
     * 新增客户组
     * 
     * @param basCustomerGroup 客户组
     * @return 结果
     */
    @Override
    public int insertBasCustomerGroup(BasCustomerGroup basCustomerGroup)
    {
        return basCustomerGroupMapper.insertBasCustomerGroup(basCustomerGroup);
    }

    /**
     * 修改客户组
     * 
     * @param basCustomerGroup 客户组
     * @return 结果
     */
    @Override
    public int updateBasCustomerGroup(BasCustomerGroup basCustomerGroup)
    {
        return basCustomerGroupMapper.updateBasCustomerGroup(basCustomerGroup);
    }

    /**
     * 删除客户组对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteBasCustomerGroupByIds(String ids)
    {
        return basCustomerGroupMapper.deleteBasCustomerGroupByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除客户组信息
     * 
     * @param customerGroupNo 客户组ID
     * @return 结果
     */
    @Override
    public int deleteBasCustomerGroupById(String customerGroupNo)
    {
        return basCustomerGroupMapper.deleteBasCustomerGroupById(customerGroupNo);
    }
}
